<%@ page import="org.apache.commons.codec.binary.Base64" %>
<%--
  Created by IntelliJ IDEA.
  User: hedingwei
  Date: 6/17/15
  Time: 9:54 AM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="tags-search" tagdir="/WEB-INF/tags/search" %>
<%@ taglib prefix="am" uri="http://pm.ambimmort.com/app/tags" %>
<%@ taglib prefix="tags-utils" tagdir="/WEB-INF/tags/utils" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <!-- Bootstrap Core CSS -->
    <link href="${ctxStatic}/css/bootstrap.css" rel="stylesheet">

    <!-- DataTables CSS -->
    <link href="${ctxStatic}/css/plugins/dataTables.bootstrap.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="${ctxStatic}/css/smartech.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="${ctxStatic}/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!-- Animate CSS -->
    <link href="${ctxStatic}/css/animate.css" rel="stylesheet">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="${ctxStatic}/js/html5shiv.js"></script>
    <script src="${ctxStatic}/js/respond.min.js"></script>
    <![endif]-->

    <!-- jQuery Version 1.11.0 -->
    <script src="${ctxStatic}/js/jquery-1.11.0.js"></script>
    <!-- Bootstrap Core JavaScript -->
    <script src="${ctxStatic}/js/plugins/Base64.js"></script>

    <style>
        .table{ width:100% !important; font-size: 13px;}
    </style>

</head>
<body>
<script type="text/javascript">

    var data1 = {
        starttime:{
            name:"启动时间",
            type:"datetime",
            operator:[{label:"等于",name:"e"},{label:"大于等于",name:"ge"},{label:"小于等于",name:"le"},{label:"不等于",name:"ne"}],
            value:{
                type:"select",
                options:[{name:1,label:"l1"},{name:2,label:"l2"},{name:3,label:"l3"}]
            }
        },
        endtime:{
            name:"终止时间",
            type:"datetime",
            operator:[{label:"等于",name:"e"},{label:"大于等于",name:"ge"},{label:"小于等于",name:"le"},{label:"不等于",name:"ne"}],
            value:{
                type:"select",
                options:[{name:1,label:"l1"},{name:2,label:"l2"},{name:3,label:"l3"}]
            }
        },
        startby:{
            name:"启动者",
            type:"string",
            operator:[{label:"等于",name:"e"},{label:"不等于",name:"ne"}],
            value:{
                type:"select",
                options:[{name:1,label:"system"},{name:2,label:"l2"},{name:3,label:"l3"}]
            }
        },
        result:{
            name:"执行结果",
            type:"string",
            operator:[{label:"等于",name:"e"},{label:"不等于",name:"ne"}],
            value:{
                type:"select",
                options:[{name:1,label:"l1"},{name:2,label:"l2"},{name:3,label:"l3"}]
            }
        }
    };

    var base64= new Base64();

    var cols = [
        {"title":"ID", "data": "id"},
        {"title":"启动时间", "data": "startTime"},
        {"title":"终止时间", "data": "endTime"},
        {"title":"结果", "data": "result"},
        {"title":"启动者", "data": "startby"},
        {
            "title":"启动备注",
            "data": "startComment",
            "render": function ( data, type, full, meta ) {
                return base64.decode(data);
            }
        },
        {
            "title":"终止备注",
            "data": "endComment",
            "render": function ( data, type, full, meta ) {
                return base64.decode(data);
            }

        },{
            "title":"操作",
            "data":"taskId",
            "render": function ( data, type, full, meta ) {

                return '<a href="${ctx}/f/lttask/log.view.do?taskId='+data+'&logId='+full.id+'">查看</a>'
            }
        }
    ];


    function confirm_delete(){
        if (!confirm("确认要删除？")) {
            window.event.returnValue = false;
        }
    }

</script>

<div id="wrapper">

    <!-- Navigation -->
    <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
        <sys:header/>
        <!-- /.navbar-top-links -->

        <sys:sidebar menuId="5100"/>
        <!-- /.navbar-static-side -->
    </nav>

    <div id="page-wrapper">

        <div class="row" >
            <div class="col-md-12">

                <div class="panel panel-default">
                    <div class="panel-heading">

                        <div class="">
                            <tags-search:btn-setting id="mysearch" pattern="data1">
                                <tags-search:group>
                                    <tags-search:and>
                                        <tags-search:predicate name="startby" operator="等于" value="system"/>
                                    </tags-search:and>
                                </tags-search:group>
                            </tags-search:btn-setting>
                            <tags-search:btn-search id="xs" tableId="table1" searchId="mysearch" url="/a/f/lttask/loglist.json.do?taskId=${taskId}" columns="cols"/>
                        </div>
                    </div><!-- /.box-header -->
                    <div class="panel-body">

                        <div class="row" >
                            <div class="alert ">

                                <b>查询条件：</b>
                                <tags-search:description searchId="mysearch"/>
                            </div>
                        </div>

                        <div class="row" >
                            <div class="col-md-12">

                                <tags-search:table id="table1" sclass="table table-primary table-bordered table-striped table-hover table-condensed"/>
                            </div>

                        </div>

                    </div>
                </div>

            </div>
        </div>

        <div class="text-center margin-top footer">&copy; 2015北京坤腾畅联科技有限公司 版权所有</div>

    </div>

</div>

<script src="${ctxStatic}/js/bootstrap.min.js"></script>
<script src="${ctxStatic}/js/plugins/layer/layer.js"></script>
<!-- DataTables JavaScript -->
<script src="${ctxStatic}/js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="${ctxStatic}/js/plugins/dataTables/dataTables.bootstrap.js"></script>
<!-- Custom Theme JavaScript -->
<script src="${ctxStatic}/js/smartech.js"></script>


</body>
</html>
